<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:inputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
    xmlns:layoutToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
    xmlns:System="clr-namespace:System;assembly=mscorlib" 
    mc:Ignorable="d"
    d:DesignWidth="330" d:DesignHeight="600"
    xmlns:local="clr-namespace:Rawr.ProtWarr"
    x:Class="Rawr.ProtWarr.CalculationOptionsPanelProtWarr"
    >

    <UserControl.Resources>
        <local:CalculationOptionsProtWarr x:Key="CalculationOptionsProtWarrDataSource" d:IsDataSource="True"/>
        <local:RankingModeConverter x:Key="RankingModeConverter"/>
        <local:ThreatValueConverter x:Key="ThreatValueConverter"/>
        <local:PercentConverter x:Key="PercentConverter"/>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource CalculationOptionsProtWarrDataSource}}">
        <controls:TabControl>
            <controls:TabItem Header="Basics">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <!-- ============= Weighting Adjustments ============= -->
                    <Border Grid.Row="0" Grid.ColumnSpan="4" Background="AliceBlue" BorderBrush="LightSteelBlue" BorderThickness="1">
                        <TextBlock Margin="4" FontWeight="Bold" Text="Weighting Adjustments" />
                    </Border>
                    <!-- Rating Mode -->
                    <TextBlock Margin="4,2" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="1" Text="Ranking Mode:" TextAlignment="Left" VerticalAlignment="Center" />
                    <ComboBox Grid.Row="1" Grid.Column="1" Margin="2" SelectedItem="{Binding Path=RankingMode, Converter={StaticResource RankingModeConverter}, Mode=TwoWay}" Grid.ColumnSpan="3">
                        <System:String>Mitigation Scale</System:String>
                        <System:String>Burst Time</System:String>
                        <System:String>CT Coverage</System:String>
                    </ComboBox>
                    <!-- Notice -->
                    <TextBlock FontSize="10" Grid.Row="2" Grid.ColumnSpan="4" Margin="4,2" TextWrapping="Wrap"
                               Text="The following settings will adjust the overall scores for each type. This does not involve Stat Weights as described by Pawn, SimCraft or other similar utilities. These are meant to describe your general importance to each point." />
                    <!-- Hits to Survive -->
                    <TextBlock x:Name="LB_HitsToSurvive" Grid.Row="3" Margin="4,2" Text="Hits to Survive:" TextAlignment="Left" VerticalAlignment="Center" />
                    <Slider Margin="2" x:Name="SL_HitsToSurvive" Grid.Row="3" Grid.Column="1"
                            Minimum="{Binding ElementName=NUD_HitsToSurvive, Path=Minimum}"
                            Maximum="{Binding ElementName=NUD_HitsToSurvive, Path=Maximum}"
                            LargeChange="{Binding ElementName=NUD_HitsToSurvive, Path=Increment}"
                            SmallChange="0.01"
                            Value="{Binding Mode=TwoWay, Path=HitsToSurvive}" />
                    <inputToolkit:NumericUpDown x:Name="NUD_HitsToSurvive" Grid.Row="3" Grid.Column="2" Margin="2" MinWidth="50"
                            Minimum="0" Maximum="10" DecimalPlaces="1" Increment="0.1"
                            Value="{Binding Path=HitsToSurvive, Mode=TwoWay}" />
                    <Button Margin="2" x:Name="BT_HitsToSurvive" Grid.Row="3" Grid.Column="3" Content="Reset" Click="btnResetHitsToSurvive_Click"
                            ToolTipService.ToolTip="Click to reset the Hits to Survive to 3.5" />
                    <!-- Burst Scale -->
                    <TextBlock x:Name="LB_BurstScale" Grid.Row="4" Margin="4,2" Text="Burst Scale:" TextAlignment="Left" VerticalAlignment="Center" />
                    <Slider Margin="2" x:Name="SL_BurstScale" Grid.Row="4" Grid.Column="1" IsEnabled="False"
                            Minimum="{Binding ElementName=NUD_BurstScale, Path=Minimum}"
                            Maximum="{Binding ElementName=NUD_BurstScale, Path=Maximum}"
                            LargeChange="{Binding ElementName=NUD_BurstScale, Path=Increment}"
                            SmallChange="0.01"
                            Value="{Binding Mode=TwoWay, Path=BurstScale}" />
                    <inputToolkit:NumericUpDown x:Name="NUD_BurstScale" Grid.Row="4" Grid.Column="2" Margin="2" IsEnabled="False"
                            Minimum="0" Maximum="10" DecimalPlaces="1" Increment="0.1"
                            Value="{Binding Path=BurstScale, Mode=TwoWay}" />
                    <Button Margin="2" x:Name="BT_BurstScale" Grid.Row="4" Grid.Column="3" Content="Reset" Click="btnResetBurstScale_Click"
                            ToolTipService.ToolTip="Click to reset the Burst Scale to 3.0" IsEnabled="False" />
                    <!-- Threat Scale -->
                    <TextBlock x:Name="LB_ThreatScale" Grid.Row="5" Margin="4,2" Text="Threat Scale:" TextAlignment="Left" VerticalAlignment="Center" />
                    <ComboBox Margin="2" x:Name="CB_ThreatScale" Grid.Row="5" Grid.Column="1" SelectedItem="{Binding Path=ThreatScale, Converter={StaticResource ThreatValueConverter}, Mode=TwoWay}">
                        <System:String>Almost None</System:String>
                        <System:String>MT</System:String>
                        <System:String>OT</System:String>
                        <System:String>Crazy About Threat</System:String>
                        <System:String>Custom...</System:String>
                    </ComboBox>
                    <inputToolkit:NumericUpDown x:Name="NUD_ThreatScale" Grid.Row="5" Grid.Column="2" Margin="2"
                            Minimum="0" Maximum="100" DecimalPlaces="1" Increment="1"
                            Value="{Binding Path=ThreatScale, Mode=TwoWay}" />
                    <Button Margin="2" x:Name="BT_ThreatScale" Grid.Row="5" Grid.Column="3" Content="Reset" Click="btnResetThreatScale_Click" ToolTipService.ToolTip="Click to reset the threat scale to 5.00" />
                    <!-- ============= Customize Rotation ============= -->
                    <Border Grid.Row="6" Grid.ColumnSpan="4" Background="AliceBlue" BorderBrush="LightSteelBlue" BorderThickness="1">
                        <TextBlock Margin="4" FontWeight="Bold" Text="Customize Rotation"/>
                    </Border>
                    <!-- Heroic Strike Frequency -->
                    <TextBlock Margin="4,2" Grid.Row="7" VerticalAlignment="Center" Text="Heroic Strike Uptime:" TextAlignment="Left" />
                    <Slider Margin="2" x:Name="SL_HeroicStrikeFrequency" Grid.Row="7" Grid.Column="1"
                            Minimum="{Binding ElementName=NUD_HeroicStrikeFrequency, Path=Minimum}"
                            Maximum="{Binding ElementName=NUD_HeroicStrikeFrequency, Path=Maximum}"
                            LargeChange="{Binding ElementName=NUD_HeroicStrikeFrequency, Path=Increment}"
                            SmallChange="1"
                            Value="{Binding Mode=TwoWay, Path=HeroicStrikeFrequency, Converter={StaticResource PercentConverter}}" />
                    <inputToolkit:NumericUpDown x:Name="NUD_HeroicStrikeFrequency" Grid.Row="7" Grid.Column="2" Margin="2"
                            Minimum="0" Maximum="100" DecimalPlaces="0" Increment="10"
                            Value="{Binding Path=HeroicStrikeFrequency, Converter={StaticResource PercentConverter}}" />
                    <TextBlock Grid.Row="7" Grid.Column="3" Margin="4,2" Text="%" VerticalAlignment="Center" />
                    <!-- Vengeance Uptime -->
                    <TextBlock Margin="4,2" Grid.Row="8" VerticalAlignment="Center" Text="Vengeance Uptime:" TextAlignment="Left" />
                    <Slider Margin="2" x:Name="SL_VengeanceUptime" Grid.Row="8" Grid.Column="1"
                            Minimum="{Binding ElementName=NUD_VengeanceUptime, Path=Minimum}"
                            Maximum="{Binding ElementName=NUD_VengeanceUptime, Path=Maximum}"
                            LargeChange="{Binding ElementName=NUD_VengeanceUptime, Path=Increment}"
                            SmallChange="0.01"
                            Value="{Binding Mode=TwoWay, Path=AverageVengeance, Converter={StaticResource PercentConverter}}" />
                    <inputToolkit:NumericUpDown x:Name="NUD_VengeanceUptime" Grid.Row="8" Grid.Column="2" Margin="2"
                            Minimum="0" Maximum="100" DecimalPlaces="0" Increment="10" 
                            Value="{Binding Path=AverageVengeance, Converter={StaticResource PercentConverter}}" />
                    <TextBlock Grid.Row="8" Grid.Column="3" Margin="4,2" Text="%" VerticalAlignment="Center" />
                    <!-- Average Out Shield Block -->
                    <TextBlock Margin="4,2" Grid.Row="9" VerticalAlignment="Center" Text="Average Shield Block?" TextAlignment="Left" />
                    <CheckBox Grid.Row="9" Grid.Column="1" IsChecked="{Binding Mode=TwoWay, Path=UseShieldBlock}" Margin="4,2" VerticalAlignment="Center" Grid.ColumnSpan="3" />
                    <!-- Shield Block Interval -->
                    <TextBlock Margin="4,2" Grid.Row="10" VerticalAlignment="Center" Text="Shield Block Interval:" TextAlignment="Left" />
                    <Slider Margin="2" x:Name="SL_ShieldBlockInterval" Grid.Row="10" Grid.Column="1"
                            Minimum="{Binding ElementName=NUD_ShieldBlockInterval, Path=Minimum}"
                            Maximum="{Binding ElementName=NUD_ShieldBlockInterval, Path=Maximum}"
                            LargeChange="{Binding ElementName=NUD_ShieldBlockInterval, Path=Increment}"
                            SmallChange="{Binding ElementName=NUD_ShieldBlockInterval, Path=Increment}"
                            Value="{Binding Mode=TwoWay, Path=ShieldBlockInterval}" />
                    <inputToolkit:NumericUpDown x:Name="NUD_ShieldBlockInterval" Grid.Row="10" Grid.Column="2" Margin="2" 
                            Minimum="30" Maximum="120" DecimalPlaces="0" Increment="5"
                            Value="{Binding Path=ShieldBlockInterval, Mode=TwoWay}" />
                    <TextBlock Grid.Row="10" Grid.Column="3" Margin="4,2" Text="sec" VerticalAlignment="Center" />
                    <!-- ========= PTR Mode ========= -->
                    <!-- PTR Mode has been disabled as we just had a patch release -->
                    <Border Grid.Row="11" Grid.Column="0" Grid.ColumnSpan="4" Background="AliceBlue" BorderBrush="LightSteelBlue" BorderThickness="1" Visibility="Collapsed">
                        <TextBlock Margin="4" FontWeight="Bold" Text="PTR Mode" VerticalAlignment="Center" />
                    </Border>
                    <!-- PTR Mode -->
                    <CheckBox Margin="2" x:Name="CK_PtrMode" Grid.Row="12" Content="Use PTR v4.1.0" IsChecked="{Binding Mode=TwoWay, Path=PTRMode}" Grid.ColumnSpan="4" Visibility="Collapsed" />
                    <!-- ========= Notices ========= -->
                    <!-- Notices about needing to use the Boss Handler -->
                    <Border Grid.Row="13" Grid.Column="0" Grid.ColumnSpan="4" Background="AliceBlue" BorderBrush="LightSteelBlue" BorderThickness="1">
                        <TextBlock Margin="4" FontWeight="Bold" Text="Notices" VerticalAlignment="Center" />
                    </Border>
                    <TextBlock TextWrapping="Wrap" Grid.Row="14" Margin="2" Grid.ColumnSpan="4" FontSize="10"
                        Text="Note that many of ProtWarr's stats are based on Boss Content. Please see the Boss Handler (next to Options in the Tabs above) for additional Fight Related settings you can adjust.&#x0a;&#x0a;A Fresh 85 should use An Easy Boss to start and once some gear has been gathered to appropriately defend against that, move on to The Average Boss. More details on this can be found on the Boss Handler Pane and in the Documentation of Rawr's website."/>
                </Grid>
            </controls:TabItem>
        </controls:TabControl>
    </Grid>
</UserControl>
